<?php

require_once 'init.inc';

$path[] = array('Статьи', 'articles.php');

$articleId = $par->get('articleId');

$q = createQuery("
	SELECT title, dt, txt, source
	FROM articles
	WHERE id=$articleId
");
$q->execute();
if (!$q->fetch())
{
	header('Location: articles.php');
}

$article = array();

$title = $article['title'] = $q->at(0);

$keywordsOb = new KeyWords('articles', 'id', $articleId);
$keywords = $keywordsOb->words();

$article['dt'] = $q->at(1);
$article['txt'] = $q->at(2);
$article['source'] = $q->at(3);

$q->close();

assignTemplateVars('title','keywords','article');
display('article');
?>